﻿@using Telerik.Web.Mvc.UI
@using WebSite.Views
@using WebSite.ViewModels

@model WebSite.ViewModels.EditViewModels.EditViewModel

<h2>Criar @Model.ControllerName</h2>

@using (Html.BeginForm("Create", Model.ControllerName, FormMethod.Post, new { id = "createForm", name = "createForm" }))
{
    ButtonsViewModel buttonsViewModel = Html.Buttons();
    if (Model.Message == null)
    {

        Html.ValidationSummary(true);

        @Model.GetTabsViewModel(Html)
        <br />
        buttonsViewModel.Add(ButtonType.Insert, "#", "Salvar", "javascript:createForm.submit()");
    }
    else
    {
        <div style="color:Red">@Model.Message</div><br />
    }

    @(buttonsViewModel
        .Add(ButtonType.Cancel, Url.Action("Index", Model.ControllerName), "Cancelar"))
}